﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace DemoForLinq.Common
{
    public class Contact
    {
        public int Id;
        public string Name;
        public static void PublishContacts(Contact[] contacts)
        {
            //这个public方法只是将这些联系人写入控制台窗口
            foreach (var contact in contacts)
            {
                Console.WriteLine("Contact Id：{0} Contact:{1}",contact.Id,contact.Name);
            }
        }
    }

    public class Employee
    {
        public int id;
        public string firstName;
        public string lastName;
        public static ArrayList GetEmployees()
        {
            //真实代码中，这里一般会进行数据库查询操作
            ArrayList al=new ArrayList();
            //初始化对象
            al.Add(new Employee {id = 1, firstName = "Joe", lastName = "Rattz"});
            al.Add(new Employee {id = 2, firstName = "William", lastName = "Gates"});
            al.Add(new Employee {id = 3, firstName = "Anders", lastName = "Hejlsberg"});
            return (al);
        }
    }
}
